.class public Lcn/cheln/explorer/actions/sort/ObjectSort;
.super Ljava/lang/Object;

# interfaces
.implements Lcn/cheln/explorer/actions/sort/a;
.implements Ljava/util/Comparator;


# instance fields
.field private a:I

.field private b:I


# direct methods
.method public constructor <init>(II)V
    .locals 1

    const/4 v0, -0x1

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput v0, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    iput v0, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    iput p1, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    iput p2, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    return-void
.end method

.method private static a(Lcn/cheln/explorer/beans/FileInfo;)V
    .locals 1

    iget-boolean v0, p0, Lcn/cheln/explorer/beans/FileInfo;->isFileBuilt:Z

    if-nez v0, :cond_0

    invoke-virtual {p0}, Lcn/cheln/explorer/beans/FileInfo;->m()V

    :cond_0
    return-void
.end method


# virtual methods
.method public final a()I
    .locals 1

    iget v0, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    return v0
.end method

.method public a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;)I
    .locals 6

    const/4 v5, 0x0

    const/4 v3, -0x1

    const/4 v4, 0x1

    invoke-static {p1}, Lcn/cheln/explorer/actions/sort/ObjectSort;->a(Lcn/cheln/explorer/beans/FileInfo;)V

    invoke-static {p2}, Lcn/cheln/explorer/actions/sort/ObjectSort;->a(Lcn/cheln/explorer/beans/FileInfo;)V

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_1

    move v0, v3

    :cond_0
    :goto_0
    return v0

    :cond_1
    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-nez v0, :cond_2

    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->c()Ljava/lang/Boolean;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Boolean;->booleanValue()Z

    move-result v0

    if-eqz v0, :cond_2

    move v0, v4

    goto :goto_0

    :cond_2
    iget v0, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    packed-switch v0, :pswitch_data_0

    :cond_3
    move v0, v5

    :goto_1
    iget v1, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    if-eq v1, v4, :cond_0

    neg-int v0, v0

    goto :goto_0

    :pswitch_0
    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->e()Ljava/lang/Long;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v0

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->e()Ljava/lang/Long;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    sub-long/2addr v0, v2

    long-to-int v0, v0

    goto :goto_1

    :pswitch_1
    iget-object v0, p1, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    if-nez v0, :cond_4

    new-instance v0, Ljava/util/Date;

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->d()Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    invoke-direct {v0, v1, v2}, Ljava/util/Date;-><init>(J)V

    iput-object v0, p1, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    :cond_4
    iget-object v0, p2, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    if-nez v0, :cond_5

    new-instance v0, Ljava/util/Date;

    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->d()Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    invoke-direct {v0, v1, v2}, Ljava/util/Date;-><init>(J)V

    iput-object v0, p2, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    :cond_5
    iget-object v0, p1, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    iget-object v1, p2, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/util/Date;->after(Ljava/util/Date;)Z

    move-result v0

    if-eqz v0, :cond_6

    move v0, v3

    goto :goto_1

    :cond_6
    iget-object v0, p1, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    iget-object v1, p2, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/util/Date;->before(Ljava/util/Date;)Z

    move-result v0

    if-eqz v0, :cond_7

    move v0, v4

    goto :goto_1

    :cond_7
    iget-object v0, p1, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    iget-object v1, p2, Lcn/cheln/explorer/beans/FileInfo;->unformattedDate:Ljava/util/Date;

    invoke-virtual {v0, v1}, Ljava/util/Date;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    move v0, v5

    goto :goto_1

    :pswitch_2
    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->n()V

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->n()V

    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->f()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->f()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->compareToIgnoreCase(Ljava/lang/String;)I

    move-result v0

    goto :goto_1

    :pswitch_3
    invoke-virtual {p2}, Lcn/cheln/explorer/beans/FileInfo;->l()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1}, Lcn/cheln/explorer/beans/FileInfo;->l()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->compareToIgnoreCase(Ljava/lang/String;)I

    move-result v0

    goto/16 :goto_1

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_2
        :pswitch_1
        :pswitch_0
        :pswitch_3
    .end packed-switch
.end method

.method public final a(Ljava/lang/String;)Lcn/cheln/explorer/actions/sort/a;
    .locals 3

    if-eqz p1, :cond_0

    const-string v0, "image"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "audio"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "video"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "apk"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "doc"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "lewa/theme"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_1

    :cond_0
    new-instance v0, Lcn/cheln/explorer/actions/sort/DBSort;

    iget v1, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    iget v2, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    invoke-direct {v0, v1, v2}, Lcn/cheln/explorer/actions/sort/DBSort;-><init>(II)V

    :goto_0
    return-object v0

    :cond_1
    move-object v0, p0

    goto :goto_0
.end method

.method public final a(I)V
    .locals 2

    const/4 v0, -0x1

    if-ne p1, v0, :cond_0

    :goto_0
    return-void

    :cond_0
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "---- policy "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcn/cheln/support/app/c;->a(Ljava/lang/String;)V

    iput p1, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->a:I

    goto :goto_0
.end method

.method public final b()I
    .locals 1

    iget v0, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    return v0
.end method

.method public final b(I)V
    .locals 1

    const/4 v0, -0x1

    if-ne p1, v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iput p1, p0, Lcn/cheln/explorer/actions/sort/ObjectSort;->b:I

    goto :goto_0
.end method

.method public final c()Ljava/lang/Object;
    .locals 0

    return-object p0
.end method

.method public synthetic compare(Ljava/lang/Object;Ljava/lang/Object;)I
    .locals 1

    check-cast p1, Lcn/cheln/explorer/beans/FileInfo;

    check-cast p2, Lcn/cheln/explorer/beans/FileInfo;

    invoke-virtual {p0, p1, p2}, Lcn/cheln/explorer/actions/sort/ObjectSort;->a(Lcn/cheln/explorer/beans/FileInfo;Lcn/cheln/explorer/beans/FileInfo;)I

    move-result v0

    return v0
.end method
